// Vertex shader bindings

struct VertexOutput {
    @location(0) tex_coord: vec2<f32>,
    @builtin(position) position: vec4<f32>,
};

@vertex
fn vs_main(
    @location(0) a_pos: vec4<f32>,
) -> VertexOutput {
    var out: VertexOutput;
    out.tex_coord = a_pos.zw;
    out.position = vec4<f32>(
        2.0 * a_pos.x - 1.0,
        1.0 - 2.0 * a_pos.y,
        0.0,
        1.0,
    );

    return out;
}
// Fragment shader bindings

@group(0) @binding(0) var r_tex_color: texture_2d<f32>;
@group(0) @binding(1) var r_tex_sampler: sampler;

@fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
    return textureSample(r_tex_color, r_tex_sampler, in.tex_coord);
}